// 对应字典数据
import { FormatDictData, GetArrMap } from '@/utils/formatter';
import { ACE_OUTCALL } from '@/services/constant';

// 默认单选字典
export const DEFAULT_CHOOSE_COUNT = { YES: 1, NO: 0 };
export const DEFAULT_CHOOSE_LIST = [
  { text: '是', value: DEFAULT_CHOOSE_COUNT.YES },
  { text: '否', value: DEFAULT_CHOOSE_COUNT.NO },
];
export const DEFAULT_CHOOSE_DIC = GetArrMap(DEFAULT_CHOOSE_LIST, 'text');

// 默认公司名称
export const COMPANY_NAME = '招银云创(深圳)信息技术有限公司';

// 费别类型
export const COST_CATEGORY_LIST = [
  { value: '1', text: '劳务费' },
  { value: '2', text: '稿费' },
  { value: '3', text: '翻译费' },
  { value: '4', text: '审稿费' },
  { value: '5', text: '绩效支出' },
  { value: '5', text: '学生医药报销款（仅限校医院填报）' },
];
export const COST_CATEGORY_DIC = FormatDictData(COST_CATEGORY_LIST);

// 费用归属
export const COST_BELONG_LIST = [
  { text: '部门', value: '0100' },
  { text: '项目', value: '0200' },
];
export const COST_BELONG_DIC = FormatDictData(COST_BELONG_LIST);

// 费用类型
export const COST_TYPE_LIST = [
  { value: '1', text: '火车' },
  { value: '2', text: '机票' },
  { value: '3', text: '酒店' },
  { value: '4', text: '首末日往返费' },
  { value: '5', text: '其他费用' },
];
export const COST_TYPE_DIC = FormatDictData(COST_TYPE_LIST);

// 支付方式
export const PAY_TYPE_LIST = [
  { text: '个人支付', value: '01' },
  { text: '企业支付', value: '03' },
];
export const PAY_TYPE_DIC = FormatDictData(PAY_TYPE_LIST);

// 工作地点
export const WORKPLACE_LIST = [
  { value: '440300', text: '深圳' },
  { value: '310000', text: '上海' },
  { value: '110000', text: '北京' },
  { value: '440100', text: '广州' },
  { value: '330100', text: '杭州' },
  { value: '420100', text: '武汉' },
  { value: '610100', text: '西安' },
  { value: '510100', text: '成都' },
];
export const WORKPLACE_DIC = FormatDictData(PAY_TYPE_LIST);

// 差旅费报销申请的编辑模块
export const TRAVEL_COST_EDITORS = [
  {
    field: 'workplaceId',
    type: 'url',
    text: '获取工作地点列表',
  },
  {
    field: 'travelPlanId',
    type: 'url',
    text: '获取差旅计划审批列表',
  },
  {
    field: 'travelPlanDetailsId',
    type: 'url',
    text: '获取差旅计划详情',
  },
];

// const base_api = location.origin + '/liuxi-home-api';
export const TRAVEL_DEFAULT_URL = {
  workplaceList: {
    url: '/ov-admin/sys/codeInfo/getValuesByType?type=place',
  },
  serverTime: {
    url: '/ov-bpm/common/getCurrentTime',
  },
  travelPlanList: {
    url: `${ACE_OUTCALL}/travel/getPlanByUserId`,
  },
  travelPlanDetails: {
    url: `${ACE_OUTCALL}/travel/getPlanDetails`,
  },
};
